329d7f
@@ -831,9 +831,13 @@
public void close() throws IOException {
     }
 
     try {
-      tezSessionState.close(false);
+      if (tezSessionState != null) {
+        tezSessionState.close(false);
+      }
     } catch (Exception e) {
       LOG.info("Error closing tez session", e);
+    } finally {
+      tezSessionState = null;
     }
   }
 
